alien_0 = {'x_position':0,'y_position':25,'speed':'medium'}
print(f"Original position:{alien_0['x_position']}")

if alien_0['speed'] == 'slow':
    x_increment = 1
elif alien_0['speed'] == 'medium':
    x_increment = 2
else:
    x_increment = 3

alien_0['x_position'] = alien_0['x_position'] + x_increment
print(f"New position: {alien_0['x_position']}")

point_value = alien_0.get('points','No point value assigned.')
print(point_value)

#练习
#6-1
周志强 = {
    'name':'周志强',
    'age':'20',
    'city':'上饶',
}
print(周志强)

#6-3
code_dictionary = {
    'int':'整型值',
    'if':'判断语句',
    'while':'while循环',
    'range()':'数值范围',
    'for':'for循环'
}
for code_name,code_mean in code_dictionary.items():
    print(f"{code_name}:{code_mean}")

